from django.db import models

class data_province(models.Model):

    #count , name , today_confirm , total_confirm , total_nowConfirm
    #total_suspect , total_dead , total_deadRate , total_heal , total_healRate
    count = models.SmallIntegerField(verbose_name='省编号',unique=True)
    name = models.CharField(max_length=20,unique=True)
    update_time = models.CharField(max_length=20,verbose_name='更新日期')
    today_confirm = models.IntegerField(verbose_name='今日确诊')
    total_confirm = models.IntegerField(verbose_name='总共确诊')
    total_nowConfirm = models.IntegerField(verbose_name='现在确诊人数')
    total_suspect = models.IntegerField(verbose_name='疑似感染')
    total_dead = models.IntegerField(verbose_name='死亡人数')
    total_deadRate = models.FloatField(verbose_name='死亡率')
    total_heal = models.IntegerField(verbose_name='治愈人数')
    total_healRate = models.FloatField(verbose_name='治愈率')

    class Meta:
        db_table = 'db_province'
        verbose_name = '新冠-省'
    def __str__(self):
        return self.name



class data_area(models.Model):
    #count , name , today_confirm , total_confirm , total_nowConfirm
    #total_suspect , total_dead , total_deadRate , total_heal , total_healRate
    count_id = models.SmallIntegerField(verbose_name='省编号')
    name = models.CharField(max_length=20,unique=True)
    update_time = models.CharField(max_length=20,verbose_name='更新日期')
    today_confirm = models.IntegerField(verbose_name='今日确诊')
    total_confirm = models.IntegerField(verbose_name='总共确诊')
    total_nowConfirm = models.IntegerField(verbose_name='现在确诊人数')
    total_suspect = models.IntegerField(verbose_name='疑似感染')
    total_dead = models.IntegerField(verbose_name='死亡人数')
    total_deadRate = models.FloatField(verbose_name='死亡率')
    total_heal = models.IntegerField(verbose_name='治愈人数')
    total_healRate = models.FloatField(verbose_name='治愈率')

    class Meta:
        db_table = 'db_area'
        verbose_name = '新冠-市'
    def __str__(self):
        return self.name



class data_china(models.Model):
    #"id","confirmedCount","confirmedIncr","curedCount","curedIncr",
    # "currentConfirmedCount","currentConfirmedIncr","dateId","deadCount",
    # "deadIncr","suspectedCount","suspectedCountIncr","provinceName","provinceShortName"
    index = models.IntegerField(verbose_name='id',unique=True)
    total_confirm = models.IntegerField(verbose_name='总共确诊')
    today_confirm = models.IntegerField(verbose_name='今日确诊')
    total_heal = models.IntegerField(verbose_name='总共治愈')
    today_heal = models.IntegerField(verbose_name='今日治愈')
    total_nowconfirm = models.IntegerField(verbose_name='现存感染')
    today_nowconfirm = models.IntegerField(verbose_name='新增感染')
    update_time = models.IntegerField(verbose_name='跟新日期')
    total_dead = models.IntegerField(verbose_name='总共死亡')
    today_dead = models.IntegerField(verbose_name='今日死亡')
    total_suspect = models.IntegerField(verbose_name='总共疑似')
    today_suspect = models.IntegerField(verbose_name='今日疑似')
    province_name = models.CharField(max_length=20,verbose_name='省名')
    province_short_name = models.CharField(max_length=20,verbose_name='市名')

    class Meta:
        db_table = 'db_cnprovincedata'
        verbose_name = '新冠-中国'
    def __str__(self):
        return self.name